﻿<%@ page pageEncoding="UTF-8"%>
<%@include file="/util/tag.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   
    
     <%@include file="../common/head.jsp"%>
        <script language="javascript" type="text/javascript">
            //保存成功的提示信息
            function showResult() {
                showResultDiv(true);
                window.setTimeout("showResultDiv(false);", 3000);
            }
            function showResultDiv(flag) {
                var divResult = document.getElementById("save_result_info");
                if (flag)
                    divResult.style.display = "block";
                else
                    divResult.style.display = "none";

            }
            
            function valueChanged(){
            	var b = $("#costId").val()==${ser.cost.id}
            	if(b){
            		$("#error_msg").addClass("error_msg").text("请修改资费类型，或者取消修改操作。");
            	}else{
            		$("#error_msg").removeClass("error_msg").empty();
            	}
            	return !b;
            }
           
            $(function(){
            
            	$("#costId").change(function(){
            		valueChanged();
            	});
            	$('#save').click(function(){
            		if(valueChanged()){
            			var b=$('#serviceForm').submitForm('update','资费修改失败！数据并发错误。','保存成功!',$('#save_result_info'));
            			if(b){
            				$('#save_result_info').attr("class","save_success");
            			}else{
            				$('#save_result_info').attr("class","save_fail");
            			}
            			showResult();
            		}
            	});
            });
        </script>
    </head>
    <body>
        <%@include file="../common/top.jsp"%>
        <div id="main">
            <!--保存操作的提示信息-->
            <div id="save_result_info" class="save_fail">资费修改失败！数据并发错误。</div>
            <s:form theme="simple" cssClass="main_form" id="serviceForm">
                <!--必填项-->
                <div class="text_info clearfix"><span>业务账号ID：</span></div>
                <div class="input_info">
                		<s:textfield name="ser.id" readonly="true" cssClass="readonly"/>
                </div>
                <div class="text_info clearfix"><span>OS 账号：</span></div>
                <div class="input_info">
                    <input type="text" value="${ser.osUsername}" readonly class="readonly" />
                </div>
                <div class="text_info clearfix"><span>服务器 IP：</span></div>
                <div class="input_info">
                    <input type="text" value="${ser.unixHost}" readonly class="readonly" />
                </div>
                <div class="text_info clearfix"><span>资费类型：</span></div>
                <div class="input_info">
                		<s:select list="costList" listKey="id" listValue="name" name="ser.cost.id" id="costId"></s:select>
                 	<div class="validate_msg_long" id="error_msg"></div>                      
                </div>
                <!--操作按钮-->
                <div class="button_info clearfix">
                    <input type="button" value="保存" class="btn_save" id="save"/>
                    <input type="button" value="取消" class="btn_save" />
                </div>

                
                <p>业务说明：<br />
                1、修改资费后，点击保存，并未真正修改数据库中的数据；<br />
                2、提交操作到消息队列；<br />
                3、每月月底由程序自动完成业务所关联的资费；</p>
                
           </s:form> 
        </div>
        
        <%@include file="../common/bottom.jsp"%>
    </body>
</html>
